/**
 * Anderground project - Subway maps processor application.
 * Copyright (C) 2008-2009 Eldar Abusalimov, Ilya Shurigyn
 * 
 * This file is part of Anderground.
 * 
 * Anderground is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 * 
 * Anderground is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with Anderground.  If not, see <http://www.gnu.org/licenses/>.
 */

package org.anderground.modules.drawer.rapid;

import static org.anderground.modules.drawer.rapid.Config.transferWidth;
import static org.anderground.modules.drawer.rapid.Config.tunnelWidth;

import org.anderground.core.graphics.Canvas;
import org.anderground.core.graphics.Paint;
import org.anderground.internal.graphics.abstaractions.AbstractPaint.Style;

public abstract class LinkDrawer {

	private static Paint tunnelPaint = new Paint();

	private static Paint transferPaint = new Paint();

	static {

		tunnelPaint.setAntiAlias(true);
		tunnelPaint.setStrokeCap(Paint.Cap.ROUND);

		transferPaint.setAntiAlias(true);
		transferPaint.setStrokeCap(Paint.Cap.BUTT);
		transferPaint.setStyle(Style.FILL_AND_STROKE);
		transferPaint.setColor(Config.DEFAULT_COLOR);

	}

	public static void setup() {
		tunnelPaint.setStrokeWidth(tunnelWidth);
		transferPaint.setStrokeWidth(transferWidth);
	}

	public static Paint getTransferPaint() {
		return transferPaint;
	}

	public static Paint getTunnelPaint() {
		return tunnelPaint;
	}

	public abstract void draw(Canvas canvas, Link link);

}
